home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programmer's Power Pack
/
Delphi Volume 1.iso
/
s_to_z
/
vpe_130
/
delphi
/
vpengine.pas
< prev
Wrap
Pascal/Delphi Source File
|
1996-09-15
|
18KB
|
518 lines
unit VPENGINE;
interface
Uses WinTypes, WinProcs
{$IFDEF VER80}
,Messages; {Units for Delphi}
{$ELSE}
;
{$ENDIF}
{/// }
{/// VPECOMON.H }
{/// ========== }
{/// }
{/// Common definitions for the "Virtual Print Engine" }
{/// }
{/// 01/95 by IDEAL Software, T. Radde }
{/// }
{/// VpeOpenDoc() Flag Parameters: }
{/// ============================= }
Const VPE_GRID_INBACKGROUND = 1; {// Grid in Background}
VPE_GRID_INFOREGROUND = 2; {// Grid in Foreground}
VPE_GRID_TOOLBARBUTTON = 4; {// Grid Toolbar-Button visible}
VPE_GRID_VISIBLE = 8; {// Actually Grid visible}
VPE_NO_RULER = 16; {// Ruler NOT visible}
VPE_NO_TOOLBAR = 32; {// Toolbar NOT visible}
VPE_NO_USER_CLOSE = 64; {// User can't close VPE -}
{/// Stop-Button INVISIBLE and Sys-Menu }
{/// disabled (if not embedded) }
{/// VpeCloseDoc() works! }
VPE_NO_USER_MOVE = 128; {// User can't leaf through the document}
{/// in future: then no Page-Seg in Statusbar }
VPE_NO_MOUSE_SCALE = 256; {// User can't scale with the MOUSE (VpeSetScale() works!)}
VPE_NO_USER_SCALE = (512 or VPE_NO_MOUSE_SCALE); {// User can't scale (VpeSetScale() works!)}
{/// in future: then no Scale-Seg in Statusbar }
VPE_NO_STATBAR = 1024; {// Statusbar invisible}
VPE_NO_PRINTBUTTON = 2048; {// Print-Button invisible}
{/// VpePrintDoc() works }
VPE_EMBEDDED = 4096; {// Document Window is embedded within}
{/// a window of the calling application }
VPE_LANDSCAPE = 8192; {// Document will be printed in Landscape-Format}
VPE_MEMORY_SWAP = 16384; {// Each page is swapped to a temporary file, so that}
{/// only one page is held in memory (NOT implemented yet!) }
VPE_NO_HELPBTN = 32768; {// Help-Button invisible}
VPE_ROUTE_HELP = 65536; {// if Help-Button visible, pressing this or pushing the F1-key}
{/// will cause the message VPE_HELP to be send to the owner-window, }
{/// no matter if the VPE-window is embedded or not }
VPE_NO_INFOBTN = 131072; {// Info-Button invisible}
VPE_GRID_POSSIBLE = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON);
VPE_GRID_ON = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
VPE_GRID_BKGON = (VPE_GRID_INBACKGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
VPE_GRID_OFF = 0;
{/// VpePreviewDoc() Flag Parameters: }
{/// =============================== }
VPE_SHOW_NORMAL = 1;
VPE_SHOW_MAXIMIZED = 2;
VPE_SHOW_HIDE = 3;
{/// Text-Formatting Attributes: }
{/// =========================== }
ALIGN_LEFT = 0;
ALIGN_RIGHT = 1;
ALIGN_CENTER = 2;
ALIGN_JUSTIFIED = 3;
ALIGN_PRINT = 4;
{/// Frame Attributes: }
{/// ================= }
FRAME_INSIDE = 0;
FRAME_OUTSIDE = 1;
FRAME_ONCENTER = 2;
{/// Picture Attributes: }
{/// =================== }
VPE_PIC_MERGE = 1; {// merge background with bitmap (SRCAND instead of SRCCOPY)}
VPE_PIC_KEEPIMAGE = 2; {// The KEEP-Flags are only relevant when working with a preview.}
{/// An image is the (uncompressed and sometimes huge) data in the file }
{/// that is read into memory. A DIB is an image rendered to the device }
{/// and another (sometimes huge) datablock. }
{/// VPE does the following: }
{/// On VpePicture() the whole image is read into memory and the the image-dimensions }
{/// are calculated. Afterwards the image is immediately removed from memory. }
{/// When the preview opens, and if the picture has to be drawn (LOOP), the image }
{/// is read again into memory and then the DIB is rendered. }
{/// Afterwards the image-data is immediately removed from memory, since only the }
{/// DIB is needed to be displayed. }
{/// The DIB is held in memory until the user moves to another page. }
{/// When printing with the open preview, the DIB is removed, the image-data }
{/// is read in and a new DIB is rendered to the capabilities of the new output device. }
{/// After the DIB is printed, it is immediately removed from memory. }
{/// The things then continue at "LOOP". }
{/// This is the standard behaviour of VPE and a balance between execution speed }
{/// and memory usage. }
{/// So with the flag VPE_PIC_KEEPIMAGE the turn-around between displaying and }
{/// printing will speed up. }
{/// It is also useful, when having only one page (or multiple pages with small }
{/// Bitmaps) in an open preview, since VPE reads the image-data twice }
{/// (for getting the dimensions and then for displaying). }
VPE_PIC_DISCARD_DIB_DRAW = 4; {// VPE holds in a preview all DIB's in memory until the user moves to}
{/// another page. Using this flag will discard the DIB immediately after drawing }
{/// from memory }
VPE_PIC_KEEP_DIB_PAGE = 8; {// VPE discards in a preview all DIB's from memory when the user moves}
{/// to another page. Using this flag will stop this mechanism. Also it overrides }
{/// the VPE_PIC_DISCARD_DIB_DRAW flag. }
{/// ======================================================================== }
{/// Notification Messages: }
{/// ======================================================================== }
VPE_DESTROYWINDOW = WM_USER + 2306;
VPE_PRINT = WM_USER + 2307;
VPE_PRINTCANCEL = WM_USER + 2308;
VPE_HELP = WM_USER + 2309;
{/// ======================================================================== }
{/// Barcode Types: }
{/// ======================================================================== }
BCT_EAN13 = 1;
BCT_EAN8 = 2;
BCT_UPCA = 3;
BCT_CODABAR = 5;
BCT_CODE39 = 6;
BCT_2OF5 = 7;
BCT_INTERLEAVED2OF5 = 8;
BCT_UPCE = 9;
BCT_EAN13_2 = 10;
BCT_EAN13_5 = 11;
BCT_EAN8_2 = 12;
BCT_EAN8_5 = 13;
BCT_UPCA_2 = 14;
BCT_UPCA_5 = 15;
BCT_UPCE_2 = 16;
BCT_UPCE_5 = 17;
BCT_EAN128A = 18;
BCT_EAN128B = 19;
BCT_EAN128C = 20;
BCT_CODE93 = 21;
BCT_POSTNET = 22;
{/// ======================================================================== }
{/// Positioning Codes: }
{/// ======================================================================== }
VFREE = -1;
VLEFT = -2;
VRIGHT = -3;
VLEFTMARGIN = -4;
VRIGHTMARGIN = -5;
VTOP = -6;
VBOTTOM = -7;
VTOPMARGIN = -8;
VBOTTOMMARGIN = -9;
{/// }
{/// VPIFACE.H }
{/// ========= }
{/// }
{/// The DLL-Interface for the "Virtual Print Engine". }
{/// }
{/// To be used by the calling applications. }
{/// }
{/// external Macro-Definitions: }
{/// WINDOWS_DLL generates Windows DLL-Code, else Windows static library }
{/// }
{/// 11/94 by IDEAL Software, T. Radde }
{/// }
function VpeGetVersion: Integer;
function VpeOpenDoc(hWndParent: HWND;
title: PChar;
page_width: Integer;
page_height: Integer;
flags: LongInt): LongInt;
function VpeCloseDoc(hDoc: LongInt): Integer;
function VpeWindowHandle(hDoc: LongInt): HWND;
procedure VpeSetDefaultOutputRect(hDoc: LongInt;
r: PRECT);
procedure VpeSetOutputRect(hDoc: LongInt;
r: PRECT);
procedure VpeGetOutputRect(hDoc: LongInt;
r: PRECT);
procedure VpeSetPosRect(hDoc: LongInt;
r: PRECT);
procedure VpeGetPosRect(hDoc: LongInt;
r: PRECT);
procedure VpeSet(hDoc: LongInt;
what: Integer;
value: Integer);
function VpeGet(hDoc: LongInt;
what: Integer): Integer;
procedure VpeStorePos(hDoc: LongInt);
procedure VpeRestorePos(hDoc: LongInt);
procedure V